package smartcrud.spring.controllers.rbac.editor;

import java.beans.PropertyEditorSupport;

import smartcrud.spring.models.rbac.Role;
/**
 * @author cyper.yin
 *
 */
public class RoleEditor extends PropertyEditorSupport {
	@Override
	public void setAsText(String text) throws IllegalArgumentException {
		if (text != null) {
			Role role = new Role();
			role.setId(Long.valueOf(text));
			setValue(role);
		} else {
			setValue(null);
		}
	}
}
